<!DOCTYPE html>












  


<html class="theme-next muse use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">






  
  
    
      
    
    
      
    
  <script src="//cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js"></script>
  <link href="//cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-flash.min.css" rel="stylesheet">



<script>
    (function () {
        if ('') {
            if (prompt('请输入文章密码') !== '') {
                alert('密码错误！');
                if (history.length === 1) {
                    location.replace("http://xxxxxxx.xxx"); // 这里替换成你的首页
                } else {
                    history.back();
                }
            }
        }
    })();
</script>





<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="zrNUWIf25v2J4dC1wliso_DUXEwYoECv4j3h9CE34xM">








  <meta name="baidu-site-verification" content="nuHze5uXZ7">







  
  
    
  
  <link href="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet" type="text/css">




  
  
  
  

  
    
    
  

  
    
      
    

    
  

  

  

  
    
      
    

    
  

  
    
    
    <link href="https://fonts.cat.net/css?family=Lato:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Roboto Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






  

<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">




<link href="/css/main.css?v=6.4.2" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.4.2">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.ico?v=6.4.2">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.4.2">


  <link rel="mask-icon" href="/images/logo.svg?v=6.4.2" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '6.4.2',
    sidebar: {"position":"left","display":"always","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果">
<meta name="keywords" content="Hexo,Next主题">
<meta property="og:type" content="article">
<meta property="og:title" content="Next主题个性化设置">
<meta property="og:url" content="https://blog.codenote.pro/next-theme-personalization.html">
<meta property="og:site_name" content="九阳的笔记本">
<meta property="og:description" content="看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-20-53-02.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-20-55-00.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-20-55-34.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-20-56-04.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-20-56-39.png">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/5308475-ef603580be708882.gif">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/5308475-78e64c0a80bb559e.gif">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/5308475-8cc4fc18c399af7e.gif">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-01-21.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-02-05.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-05-36.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-06-19.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-06-44.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-07-15.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-08-04.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-09-10.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-09-52.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-10-08.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-15-44.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-19-18.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-25-02.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-26-06.png">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/5308475-0c7e5e61b78dc937.gif">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-27-30.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-31-08.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-31-21.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-31-40.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-37-32.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-39-30.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-39-53.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-41-07.png">
<meta property="og:image" content="http://qn.codenote.pro/2018-09-28-21-41-23.png">
<meta property="og:updated_time" content="2018-11-01T16:22:00.480Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Next主题个性化设置">
<meta name="twitter:description" content="看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果">
<meta name="twitter:image" content="http://qn.codenote.pro/2018-09-28-20-53-02.png">



  <link rel="alternate" href="/atom.xml" title="九阳的笔记本" type="application/atom+xml">




  <link rel="canonical" href="https://blog.codenote.pro/next-theme-personalization.html">



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>Next主题个性化设置 | 九阳的笔记本</title>
  




<script async src="https://www.googletagmanager.com/gtag/js?id=UA-126970002-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-126970002-1');
</script>



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?07b2f6778635ec267ee2b4753e118da9";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
     
    
    
    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">九阳的笔记本</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-hexo">
    <a href="/categories/Hexo" rel="section">
      <i class="menu-item-icon fa fa-fw fa-header"></i> <br>Hexo</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-linux">
    <a href="/categories/Linux" rel="section">
      <i class="menu-item-icon fa fa-fw fa-linux"></i> <br>Linux</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-docker">
    <a href="/categories/docker" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>docker</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-learn">
    <a href="/categories/learn" rel="section">
      <i class="menu-item-icon fa fa-fw fa-leanpub"></i> <br>学习</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-top">
    <a href="/top/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-signal"></i> <br>阅读排行</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">
    <a href="/sitemap.xml" rel="section">
      <i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-about">
    <a href="/about/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>
  </li>

      
      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  
    

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://blog.codenote.pro/next-theme-personalization.html">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="yszar">
      <meta itemprop="description" content="学无止境！">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="九阳的笔记本">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">Next主题个性化设置
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-09-28 20:25:51" itemprop="dateCreated datePublished" datetime="2018-09-28T20:25:51+08:00">2018-09-28</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2018-11-02 00:22:00" itemprop="dateModified" datetime="2018-11-02T00:22:00+08:00">2018-11-02</time>
              
            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope="" itemtype="http://schema.org/Thing"><a href="/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/next-theme-personalization.html" class="leancloud_visitors" data-flag-title="Next主题个性化设置">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数：</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          
              <div class="post-description">看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果</div>
          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p></p><p class="description">看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果</p><br><a id="more"></a><p></p>
<blockquote>
<p>看到有些next主题的网站很炫酷，那么是怎么配置的呢？接下来我会讲一讲如何实现一些炫酷的效果</p>
</blockquote>
<p>主要有以下32种：</p>
<ul>
<li>在右上角或者左上角实现fork me on github</li>
<li>添加RSS</li>
<li>添加动态背景</li>
<li>实现点击出现桃心效果</li>
<li>修改文章内链接文本样式</li>
<li>修改文章底部的那个带#号的标签</li>
<li>在每篇文章末尾统一添加“本文结束”标记</li>
<li>修改作者头像并旋转</li>
<li>博文压缩</li>
<li>修改<code></code>代码块自定义样式</li>
<li>侧边栏社交小图标设置</li>
<li>主页文章添加阴影效果</li>
<li>在网站底部加上访问量</li>
<li>添加热度</li>
<li>网站底部字数统计</li>
<li>添加 README.md 文件</li>
<li>设置网站的图标Favicon</li>
<li>实现统计功能</li>
<li>添加顶部加载条</li>
<li>在文章底部增加版权信息</li>
<li>添加网易云跟帖(跟帖关闭，已失效，改为来必力)</li>
<li>隐藏网页底部powered By Hexo / 强力驱动</li>
<li>修改网页底部的桃心</li>
<li>文章加密访问</li>
<li>添加jiathis分享</li>
<li>博文置顶</li>
<li>修改字体大小</li>
<li>修改打赏字体不闪动</li>
<li>自定义鼠标样式</li>
<li>为博客加上萌萌的宠物</li>
<li>DaoVoice 在线联系</li>
<li>点击爆炸效果</li>
</ul>
<h1 id="1-在右上角或者左上角实现fork-me-on-github"><a href="#1-在右上角或者左上角实现fork-me-on-github" class="headerlink" title="1. 在右上角或者左上角实现fork me on github"></a>1. 在右上角或者左上角实现fork me on github</h1><h3 id="实现效果图"><a href="#实现效果图" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-20-53-02.png" alt="2018-09-28-20-53-02.png"></p>
<h3 id="具体实现方法"><a href="#具体实现方法" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>点击<a href="https://github.com/blog/273-github-ribbons" rel="external nofollow noopener noreferrer" target="_blank">这里</a> 或者 <a href="http://tholman.com/github-corners/" rel="external nofollow noopener noreferrer" target="_blank">这里</a>挑选自己喜欢的样式，并复制代码。 例如，我是复制如下代码：<br><img src="http://qn.codenote.pro/2018-09-28-20-55-00.png" alt="2018-09-28-20-55-00.png"></p>
<p>然后粘贴刚才复制的代码到<code>themes/next/layout/_layout.swig</code>文件中(放在<code>&lt;div class=&quot;headband&quot;&gt;&lt;/div&gt;</code>的下面)，并把<code>href</code>改为你的github地址</p>
<hr>
<h1 id="2-添加RSS"><a href="#2-添加RSS" class="headerlink" title="2.添加RSS"></a>2.添加RSS</h1><h3 id="实现效果图-1"><a href="#实现效果图-1" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-20-55-34.png" alt="2018-09-28-20-55-34.png"></p>
<h3 id="具体实现方法-1"><a href="#具体实现方法-1" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>切换到你的blog（我是取名blog，具体的看你们的取名是什么）的路径，例如我是在<code>/Users/chenzekun/Code/Hexo/blog</code>这个路径上，也就是在你的根目录下<br><img src="http://qn.codenote.pro/2018-09-28-20-56-04.png" alt="2018-09-28-20-56-04.png"><br>然后安装 Hexo 插件：(这个插件会放在<code>node_modules</code>这个文件夹里)</p>
<pre><code>$ npm install --save hexo-generator-feed
</code></pre><p>接下来打开画红线的文件，如下图：<br><img src="http://qn.codenote.pro/2018-09-28-20-56-39.png" alt="2018-09-28-20-56-39.png"></p>
<p>在里面的末尾添加：(<strong>请注意</strong>在冒号后面要加一个空格，不然会发生错误！)</p>
<pre><code># Extensions
## Plugins: http://hexo.io/plugins/
plugins: hexo-generate-feed
</code></pre><p>然后打开next主题文件夹里面的<code>_config.yml</code>,在里面配置为如下样子：(就是在<code>rss:</code>的后面加上<code>/atom.xml</code>,<strong>注意</strong>在冒号后面要加一个空格)</p>
<pre><code># Set rss to false to disable feed link.
# Leave rss as empty to use site&apos;s feed link.
# Set rss to specific value if you have burned your feed already.
rss: /atom.xml
</code></pre><p>配置完之后运行：</p>
<pre><code>$ hexo g
</code></pre><p>重新生成一次，你会在<code>./public</code> 文件夹中看到 <code>atom.xml</code> 文件。然后启动服务器查看是否有效，之后再部署到 Github 中。</p>
<hr>
<h1 id="3-添加动态背景-未使用"><a href="#3-添加动态背景-未使用" class="headerlink" title="3. 添加动态背景(未使用)"></a>3. 添加动态背景(未使用)</h1><h3 id="实现效果图-2"><a href="#实现效果图-2" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="https://upload-images.jianshu.io/upload_images/5308475-ef603580be708882.gif" alt="https://upload-images.jianshu.io/upload_images/5308475-ef603580be708882.gif"></p>
<h3 id="具体实现方法-2"><a href="#具体实现方法-2" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p><a href="http://shenzekun.cn/hexo%E5%A6%82%E4%BD%95%E6%B7%BB%E5%8A%A0%E5%8A%A8%E6%80%81%E8%83%8C%E6%99%AF.html" rel="external nofollow noopener noreferrer" target="_blank">参考链接</a></p>
<hr>
<h1 id="4-实现点击出现桃心效果-未使用"><a href="#4-实现点击出现桃心效果-未使用" class="headerlink" title="4. 实现点击出现桃心效果(未使用)"></a>4. 实现点击出现桃心效果(未使用)</h1><h3 id="实现效果图-3"><a href="#实现效果图-3" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="https://upload-images.jianshu.io/upload_images/5308475-78e64c0a80bb559e.gif" alt="https://upload-images.jianshu.io/upload_images/5308475-78e64c0a80bb559e.gif"></p>
<h3 id="具体实现方法-3"><a href="#具体实现方法-3" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>在网址输入如下</p>
<pre><code>http://7u2ss1.com1.z0.glb.clouddn.com/love.js
</code></pre><p>然后将里面的代码copy一下，新建<code>love.js</code>文件并且将代码复制进去，然后保存。将<code>love.js</code>文件放到路径<code>/themes/next/source/js/src</code>里面，然后打开<code>\themes\next\layout\_layout.swig</code>文件,在末尾（在前面引用会出现找不到的bug）添加以下代码：</p>
<pre><code>&lt;!-- 页面点击小红心 --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/src/love.js&quot;&gt;&lt;/script&gt;
</code></pre><hr>
<h1 id="5-修改文章内链接文本样式（未使用）"><a href="#5-修改文章内链接文本样式（未使用）" class="headerlink" title="5. 修改文章内链接文本样式（未使用）"></a>5. 修改文章内链接文本样式（未使用）</h1><h3 id="实现效果图-4"><a href="#实现效果图-4" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="https://upload-images.jianshu.io/upload_images/5308475-8cc4fc18c399af7e.gif" alt="https://upload-images.jianshu.io/upload_images/5308475-8cc4fc18c399af7e.gif"></p>
<h3 id="具体实现方法-4"><a href="#具体实现方法-4" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>修改文件 <code>themes\next\source\css\_common\components\post\post.styl</code>，在末尾添加如下css样式，：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></div><div class="code"><pre><div class="line">// 文章内链接文本样式</div><div class="line"><span class="selector-class">.post-body</span> <span class="selector-tag">p</span> <span class="selector-tag">a</span>&#123;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#0593d3</span>;</div><div class="line">  <span class="attribute">border-bottom</span>: none;</div><div class="line">  <span class="attribute">border-bottom</span>: <span class="number">1px</span> solid <span class="number">#0593d3</span>;</div><div class="line">  &amp;:hover &#123;</div><div class="line">    <span class="selector-tag">color</span>: <span class="selector-id">#fc6423</span>;</div><div class="line">    <span class="selector-tag">border-bottom</span>: <span class="selector-tag">none</span>;</div><div class="line">    <span class="selector-tag">border-bottom</span>: 1<span class="selector-tag">px</span> <span class="selector-tag">solid</span> <span class="selector-id">#fc6423</span>;</div><div class="line">  &#125;</div><div class="line">&#125;</div></pre></div></div></figure>
<p>其中选择<code>.post-body</code> 是为了不影响标题，选择 <code>p</code> 是为了不影响首页“阅读全文”的显示样式,颜色可以自己定义。</p>
<hr>
<h1 id="6-修改文章底部的那个带-号的标签"><a href="#6-修改文章底部的那个带-号的标签" class="headerlink" title="6. 修改文章底部的那个带#号的标签"></a>6. 修改文章底部的那个带#号的标签</h1><h3 id="实现效果图-5"><a href="#实现效果图-5" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-01-21.png" alt="2018-09-28-21-01-21.png"></p>
<h3 id="具体实现方法-5"><a href="#具体实现方法-5" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>修改模板<code>/themes/next/layout/_macro/post.swig</code>，搜索 <code>rel=&quot;tag&quot;&gt;#</code>，将 # 换成<code>&lt;i class=&quot;fa fa-tag&quot;&gt;&lt;/i&gt;</code></p>
<hr>
<h1 id="7-在每篇文章末尾统一添加“本文结束”标记（未使用）"><a href="#7-在每篇文章末尾统一添加“本文结束”标记（未使用）" class="headerlink" title="7. 在每篇文章末尾统一添加“本文结束”标记（未使用）"></a>7. 在每篇文章末尾统一添加“本文结束”标记（未使用）</h1><h3 id="实现效果图-6"><a href="#实现效果图-6" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-02-05.png" alt="2018-09-28-21-02-05.png"></p>
<h3 id="具体实现方法-6"><a href="#具体实现方法-6" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>在路径 <code>\themes\next\layout\_macro</code> 中新建 <code>passage-end-tag.swig</code> 文件,并添加以下内容：</p>
<figure class="highlight plain"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line">&lt;div&gt;</div><div class="line">    &#123;% if not is_index %&#125;</div><div class="line">        &lt;div style=&quot;text-align:center;color: #ccc;font-size:14px;&quot;&gt;-------------本文结束&lt;i class=&quot;fa fa-paw&quot;&gt;&lt;/i&gt;感谢您的阅读-------------&lt;/div&gt;</div><div class="line">    &#123;% endif %&#125;</div><div class="line">&lt;/div&gt;</div></pre></div></div></figure>
<p>接着打开<code>\themes\next\layout\_macro\post.swig</code>文件，在<code>post-body</code> 之后， <code>post-footer</code> 之前添加如下画红色部分代码（post-footer之前两个DIV）：</p>
<p>代码如下：</p>
<figure class="highlight"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line">&lt;<span class="selector-tag">div</span>&gt;</div><div class="line">  &#123;% if not is_index %&#125;</div><div class="line">    &#123;% include 'passage-end-tag.swig' %&#125;</div><div class="line">  &#123;% endif %&#125;</div><div class="line">&lt;/div&gt;</div></pre></div></div></figure>
<p>然后打开主题配置文件（<code>_config.yml</code>),在末尾添加：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></div><div class="code"><pre><div class="line"><span class="comment"># 文章末尾添加“本文结束”标记</span></div><div class="line"><span class="attr">passage_end_tag:</span></div><div class="line"><span class="attr">  enabled:</span> <span class="literal">true</span></div></pre></div></div></figure>
<p>完成以上设置之后，在每篇文章之后都会添加如上效果图的样子。</p>
<hr>
<h1 id="8-修改作者头像并旋转：-未使用"><a href="#8-修改作者头像并旋转：-未使用" class="headerlink" title="8. 修改作者头像并旋转：(未使用)"></a>8. 修改作者头像并旋转：(未使用)</h1><h3 id="具体实现方法-7"><a href="#具体实现方法-7" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>\themes\next\source\css\_common\components\sidebar\sidebar-author.styl</code>，在里面添加如下代码：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div></pre></div><div class="code"><pre><div class="line"><span class="selector-class">.site-author-image</span> &#123;</div><div class="line">  <span class="attribute">display</span>: block;</div><div class="line">  <span class="attribute">margin</span>: <span class="number">0</span> auto;</div><div class="line">  <span class="attribute">padding</span>: $site-author-image-padding;</div><div class="line">  <span class="attribute">max-width</span>: $site-author-image-width;</div><div class="line">  <span class="attribute">height</span>: $site-author-image-height;</div><div class="line">  <span class="attribute">border</span>: $site-author-image-border-width solid $site-author-image-border-color;</div><div class="line"></div><div class="line">  <span class="comment">/* 头像圆形 */</span></div><div class="line">  <span class="attribute">border-radius</span>: <span class="number">80px</span>;</div><div class="line">  <span class="attribute">-webkit-border-radius</span>: <span class="number">80px</span>;</div><div class="line">  <span class="attribute">-moz-border-radius</span>: <span class="number">80px</span>;</div><div class="line">  <span class="attribute">box-shadow</span>: inset <span class="number">0</span> -<span class="number">1px</span> <span class="number">0</span> <span class="number">#333</span>sf;</div><div class="line"></div><div class="line">  <span class="comment">/* 设置循环动画 [animation: (play)动画名称 (2s)动画播放时长单位秒或微秒 (ase-out)动画播放的速度曲线为以低速结束</span></div><div class="line"><span class="comment">    (1s)等待1秒然后开始动画 (1)动画播放次数(infinite为循环播放) ]*/</span></div><div class="line"></div><div class="line"></div><div class="line">  <span class="comment">/* 鼠标经过头像旋转360度 */</span></div><div class="line">  <span class="attribute">-webkit-transition</span>: -webkit-transform <span class="number">1.0s</span> ease-out;</div><div class="line">  <span class="attribute">-moz-transition</span>: -moz-transform <span class="number">1.0s</span> ease-out;</div><div class="line">  <span class="attribute">transition</span>: transform <span class="number">1.0s</span> ease-out;</div><div class="line">&#125;</div><div class="line"></div><div class="line"><span class="selector-tag">img</span><span class="selector-pseudo">:hover</span> &#123;</div><div class="line">  <span class="comment">/* 鼠标经过停止头像旋转</span></div><div class="line"><span class="comment">  -webkit-animation-play-state:paused;</span></div><div class="line"><span class="comment">  animation-play-state:paused;*/</span></div><div class="line"></div><div class="line">  <span class="comment">/* 鼠标经过头像旋转360度 */</span></div><div class="line">  <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(360deg);</div><div class="line">  <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(360deg);</div><div class="line">  <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(360deg);</div><div class="line">&#125;</div><div class="line"></div><div class="line"><span class="comment">/* Z 轴旋转动画 */</span></div><div class="line">@-<span class="keyword">webkit</span>-<span class="keyword">keyframes</span> play &#123;</div><div class="line">  0% &#123;</div><div class="line">    <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(0deg);</div><div class="line">  &#125;</div><div class="line">  100% &#123;</div><div class="line">    <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(-360deg);</div><div class="line">  &#125;</div><div class="line">&#125;</div><div class="line">@-<span class="keyword">moz</span>-<span class="keyword">keyframes</span> play &#123;</div><div class="line">  0% &#123;</div><div class="line">    <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(0deg);</div><div class="line">  &#125;</div><div class="line">  100% &#123;</div><div class="line">    <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(-360deg);</div><div class="line">  &#125;</div><div class="line">&#125;</div><div class="line">@<span class="keyword">keyframes</span> play &#123;</div><div class="line">  0% &#123;</div><div class="line">    <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(0deg);</div><div class="line">  &#125;</div><div class="line">  100% &#123;</div><div class="line">    <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(-360deg);</div><div class="line">  &#125;</div><div class="line">&#125;</div></pre></div></div></figure>
<hr>
<h1 id="9-博文压缩-未使用"><a href="#9-博文压缩-未使用" class="headerlink" title="9. 博文压缩(未使用)"></a>9. 博文压缩(未使用)</h1><p>在站点的根目录下执行以下命令：</p>
<figure class="highlight bash"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></div><div class="code"><pre><div class="line">$ npm install gulp -g</div><div class="line">$ npm install gulp-minify-css gulp-uglify gulp-htmlmin gulp-htmlclean gulp --save</div></pre></div></div></figure>
<p>在如下图所示，新建 <code>gulpfile.js</code> ，并填入以下内容：</p>
<figure class="highlight js"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div></pre></div><div class="code"><pre><div class="line"><span class="keyword">var</span> gulp = <span class="built_in">require</span>(<span class="string">'gulp'</span>);</div><div class="line"><span class="keyword">var</span> minifycss = <span class="built_in">require</span>(<span class="string">'gulp-minify-css'</span>);</div><div class="line"><span class="keyword">var</span> uglify = <span class="built_in">require</span>(<span class="string">'gulp-uglify'</span>);</div><div class="line"><span class="keyword">var</span> htmlmin = <span class="built_in">require</span>(<span class="string">'gulp-htmlmin'</span>);</div><div class="line"><span class="keyword">var</span> htmlclean = <span class="built_in">require</span>(<span class="string">'gulp-htmlclean'</span>);</div><div class="line"><span class="comment">// 压缩 public 目录 css</span></div><div class="line">gulp.task(<span class="string">'minify-css'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</div><div class="line">    <span class="keyword">return</span> gulp.src(<span class="string">'./public/**/*.css'</span>)</div><div class="line">        .pipe(minifycss())</div><div class="line">        .pipe(gulp.dest(<span class="string">'./public'</span>));</div><div class="line">&#125;);</div><div class="line"><span class="comment">// 压缩 public 目录 html</span></div><div class="line">gulp.task(<span class="string">'minify-html'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</div><div class="line">  <span class="keyword">return</span> gulp.src(<span class="string">'./public/**/*.html'</span>)</div><div class="line">    .pipe(htmlclean())</div><div class="line">    .pipe(htmlmin(&#123;</div><div class="line">         removeComments: <span class="literal">true</span>,</div><div class="line">         minifyJS: <span class="literal">true</span>,</div><div class="line">         minifyCSS: <span class="literal">true</span>,</div><div class="line">         minifyURLs: <span class="literal">true</span>,</div><div class="line">    &#125;))</div><div class="line">    .pipe(gulp.dest(<span class="string">'./public'</span>))</div><div class="line">&#125;);</div><div class="line"><span class="comment">// 压缩 public/js 目录 js</span></div><div class="line">gulp.task(<span class="string">'minify-js'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</div><div class="line">    <span class="keyword">return</span> gulp.src(<span class="string">'./public/**/*.js'</span>)</div><div class="line">        .pipe(uglify())</div><div class="line">        .pipe(gulp.dest(<span class="string">'./public'</span>));</div><div class="line">&#125;);</div><div class="line"><span class="comment">// 执行 gulp 命令时执行的任务</span></div><div class="line">gulp.task(<span class="string">'default'</span>, [</div><div class="line">    <span class="string">'minify-html'</span>,<span class="string">'minify-css'</span>,<span class="string">'minify-js'</span></div><div class="line">]);</div></pre></div></div></figure>
<p>生成博文是执行 <code>hexo g &amp;&amp; gulp</code> 就会根据 <code>gulpfile.js</code> 中的配置，对 public 目录中的静态资源文件进行压缩。</p>
<hr>
<h1 id="10-修改代码块自定义样式（未使用）"><a href="#10-修改代码块自定义样式（未使用）" class="headerlink" title="10. 修改代码块自定义样式（未使用）"></a>10. 修改<code></code>代码块自定义样式（未使用）</h1><h3 id="具体实现方法-8"><a href="#具体实现方法-8" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>\themes\next\source\css\_custom\custom.styl</code>,向里面加入：(颜色可以自己定义)</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></div><div class="code"><pre><div class="line">// Custom styles.</div><div class="line"><span class="selector-tag">code</span> &#123;</div><div class="line">    <span class="attribute">color</span>: <span class="number">#ff7600</span>;</div><div class="line">    <span class="attribute">background</span>: <span class="number">#fbf7f8</span>;</div><div class="line">    <span class="attribute">margin</span>: <span class="number">2px</span>;</div><div class="line">&#125;</div><div class="line">// 大代码块的自定义样式</div><div class="line"><span class="selector-class">.highlight</span>, <span class="selector-tag">pre</span> &#123;</div><div class="line">    <span class="attribute">margin</span>: <span class="number">5px</span> <span class="number">0</span>;</div><div class="line">    <span class="attribute">padding</span>: <span class="number">5px</span>;</div><div class="line">    <span class="attribute">border-radius</span>: <span class="number">3px</span>;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.highlight</span>, <span class="selector-tag">code</span>, <span class="selector-tag">pre</span> &#123;</div><div class="line">    <span class="attribute">border</span>: <span class="number">1px</span> solid <span class="number">#d6d6d6</span>;</div><div class="line">&#125;</div></pre></div></div></figure>
<hr>
<h1 id="11-侧边栏社交小图标设置"><a href="#11-侧边栏社交小图标设置" class="headerlink" title="11. 侧边栏社交小图标设置"></a>11. 侧边栏社交小图标设置</h1><h3 id="实现效果图-7"><a href="#实现效果图-7" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-05-36.png" alt="2018-09-28-21-05-36.png"></p>
<h3 id="具体实现方法-9"><a href="#具体实现方法-9" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开主题配置文件（<code>_config.yml</code>），搜索<code>social_icons:</code>,在<a href="http://fontawesome.io/icons/" rel="external nofollow noopener noreferrer" target="_blank">图标库</a>找自己喜欢的小图标，并将名字复制在如下位置<br><img src="http://qn.codenote.pro/2018-09-28-21-06-19.png" alt="2018-09-28-21-06-19.png"></p>
<hr>
<h1 id="12-主页文章添加阴影效果（未使用）"><a href="#12-主页文章添加阴影效果（未使用）" class="headerlink" title="12. 主页文章添加阴影效果（未使用）"></a>12. 主页文章添加阴影效果（未使用）</h1><h3 id="实现效果图-8"><a href="#实现效果图-8" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-06-44.png" alt="2018-09-28-21-06-44.png"></p>
<h3 id="具体实现方法-10"><a href="#具体实现方法-10" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>\themes\next\source\css\_custom\custom.styl</code>,向里面加入：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></div><div class="code"><pre><div class="line">// 主页文章添加阴影效果</div><div class="line"> <span class="selector-class">.post</span> &#123;</div><div class="line">   <span class="attribute">margin-top</span>: <span class="number">60px</span>;</div><div class="line">   <span class="attribute">margin-bottom</span>: <span class="number">60px</span>;</div><div class="line">   <span class="attribute">padding</span>: <span class="number">25px</span>;</div><div class="line">   <span class="attribute">-webkit-box-shadow</span>: <span class="number">0</span> <span class="number">0</span> <span class="number">5px</span> <span class="built_in">rgba</span>(202, 203, 203, .5);</div><div class="line">   <span class="attribute">-moz-box-shadow</span>: <span class="number">0</span> <span class="number">0</span> <span class="number">5px</span> <span class="built_in">rgba</span>(202, 203, 204, .5);</div><div class="line">  &#125;</div></pre></div></div></figure>
<hr>
<h1 id="13-在网站底部加上访问量（未使用）"><a href="#13-在网站底部加上访问量（未使用）" class="headerlink" title="13. 在网站底部加上访问量（未使用）"></a>13. 在网站底部加上访问量（未使用）</h1><h3 id="实现效果图-9"><a href="#实现效果图-9" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-07-15.png" alt="2018-09-28-21-07-15.png"></p>
<h3 id="具体实现方法-11"><a href="#具体实现方法-11" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>\themes\next\layout\_partials\footer.swig</code>文件,在copyright前加上画红线这句话：</p>
<p>代码如下：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">async</span> <span class="attr">src</span>=<span class="string">"https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></div></div></figure>
<p>然后再合适的位置添加显示统计的代码，如图：<br><img src="http://qn.codenote.pro/2018-09-28-21-08-04.png" alt="2018-09-28-21-08-04.png"></p>
<p>代码如下：</p>
<figure class="highlight"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line">&lt;div class="powered-by"&gt;</div><div class="line">&lt;i class="fa fa-user-md"&gt;&lt;/i&gt;&lt;span id="busuanzi_container_site_uv"&gt;</div><div class="line">  本站访客数:&lt;span id="busuanzi_value_site_uv"&gt;&lt;/span&gt;</div><div class="line">&lt;/span&gt;</div><div class="line">&lt;/div&gt;</div></pre></div></div></figure>
<p>在这里有两中不同计算方式的统计代码：</p>
<ol>
<li><strong>pv</strong>的方式，单个用户连续点击n篇文章，记录n次访问量</li>
</ol>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_container_site_pv"</span>&gt;</span></div><div class="line">    本站总访问量<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_value_site_pv"</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>次</div><div class="line"><span class="tag">&lt;/<span class="name">span</span>&gt;</span></div></pre></div></div></figure>
<ol start="2">
<li><strong>uv</strong>的方式，单个用户连续点击n篇文章，只记录1次访客数</li>
</ol>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_container_site_uv"</span>&gt;</span></div><div class="line">  本站总访问量<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_value_site_uv"</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>次</div><div class="line"><span class="tag">&lt;/<span class="name">span</span>&gt;</span></div></pre></div></div></figure>
<p>添加之后再执行<code>hexo d -g</code>，然后再刷新页面就能看到效果</p>
<hr>
<h1 id="14-添加热度（未使用）"><a href="#14-添加热度（未使用）" class="headerlink" title="14. 添加热度（未使用）"></a>14. 添加热度（未使用）</h1><h3 id="实现效果图："><a href="#实现效果图：" class="headerlink" title="实现效果图："></a>实现效果图：</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-09-10.png" alt="2018-09-28-21-09-10.png"></p>
<h3 id="具体实现方法-12"><a href="#具体实现方法-12" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>next主题集成leanCloud，打开<code>/themes/next/layout/_macro/post.swig</code>,在画红线的区域添加<code>℃</code>：</p>
<p>然后打开，<code>/themes/next/languages/zh-Hans.yml</code>,将画红框的改为热度就可以了<br><img src="http://qn.codenote.pro/2018-09-28-21-09-52.png" alt="2018-09-28-21-09-52.png"></p>
<hr>
<h1 id="15-网站底部字数统计"><a href="#15-网站底部字数统计" class="headerlink" title="15. 网站底部字数统计"></a>15. 网站底部字数统计</h1><h3 id="实现效果图-10"><a href="#实现效果图-10" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-10-08.png" alt="2018-09-28-21-10-08.png"></p>
<h3 id="具体方法实现"><a href="#具体方法实现" class="headerlink" title="具体方法实现"></a>具体方法实现</h3><p>切换到根目录下，然后运行如下代码</p>
<figure class="highlight bash"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">$ npm install hexo-wordcount --save</div></pre></div></div></figure>
<p>然后在<code>/themes/next/layout/_partials/footer.swig</code>文件尾部加上：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"theme-info"</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"powered-by"</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"post-count"</span>&gt;</span>博客全站共&#123;&#123; totalcount(site) &#125;&#125;字<span class="tag">&lt;/<span class="name">span</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div></pre></div></div></figure>
<hr>
<h1 id="16-添加-README-md-文件"><a href="#16-添加-README-md-文件" class="headerlink" title="16. 添加 README.md 文件"></a>16. 添加 README.md 文件</h1><p>每个项目下一般都有一个 <code>README.md</code> 文件，但是使用 hexo 部署到仓库后，项目下是没有 <code>README.md</code> 文件的。</p>
<p>在 Hexo 目录下的 <code>source</code> 根目录下添加一个 <code>README.md</code> 文件，修改站点配置文件 _<code>config.yml</code>，将 <code>skip_render</code> 参数的值设置为</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line"><span class="attr">skip_render:</span> <span class="string">README.md</span></div></pre></div></div></figure>
<p>保存退出即可。再次使用 <code>hexo d</code> 命令部署博客的时候就不会在渲染 README.md 这个文件了。</p>
<hr>
<h1 id="17-设置网站的图标Favicon"><a href="#17-设置网站的图标Favicon" class="headerlink" title="17. 设置网站的图标Favicon"></a>17. 设置网站的图标Favicon</h1><h3 id="具体方法实现-1"><a href="#具体方法实现-1" class="headerlink" title="具体方法实现"></a>具体方法实现</h3><p>在<a href="http://www.easyicon.net/" rel="external nofollow noopener noreferrer" target="_blank">EasyIcon</a>中找一张（32*32）的<code>ico</code>图标,或者去别的网站下载或者制作，并将图标名称改为<code>favicon.ico</code>，然后把图标放在<code>/themes/next/source/images</code>里，并且修改主题配置文件：</p>
<pre><code># Put your favicon.ico into `hexo-site/source/` directory.
favicon: /favicon.ico
</code></pre><hr>
<h1 id="18-实现统计功能"><a href="#18-实现统计功能" class="headerlink" title="18. 实现统计功能"></a>18. 实现统计功能</h1><h3 id="实现效果图-11"><a href="#实现效果图-11" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-15-44.png" alt="2018-09-28-21-15-44.png"></p>
<h3 id="具体实现方法-13"><a href="#具体实现方法-13" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>在根目录下安装 <code>hexo-wordcount</code>,运行：</p>
<figure class="highlight bash"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">$ npm install hexo-wordcount --save</div></pre></div></div></figure>
<p>然后在主题的配置文件中，配置如下：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></div><div class="code"><pre><div class="line"><span class="comment"># Post wordcount display settings</span></div><div class="line"><span class="comment"># Dependencies: https://github.com/willin/hexo-wordcount</span></div><div class="line"><span class="attr">post_wordcount:</span></div><div class="line"><span class="attr">  item_text:</span> <span class="literal">true</span></div><div class="line"><span class="attr">  wordcount:</span> <span class="literal">true</span></div><div class="line"><span class="attr">  min2read:</span> <span class="literal">true</span></div></pre></div></div></figure>
<hr>
<h1 id="19-添加顶部加载条-NexT6-x版本自带"><a href="#19-添加顶部加载条-NexT6-x版本自带" class="headerlink" title="19. 添加顶部加载条(NexT6.x版本自带)"></a>19. 添加顶部加载条(NexT6.x版本自带)</h1><h3 id="具体实现方法-14"><a href="#具体实现方法-14" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>/themes/next/layout/_partials/head.swig</code>文件，添加红框上的代码</p>
<p>代码如下：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"//cdn.bootcss.com/pace/1.0.2/pace.min.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">href</span>=<span class="string">"//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css"</span> <span class="attr">rel</span>=<span class="string">"stylesheet"</span>&gt;</span></div></pre></div></div></figure>
<p>但是，默认的是粉色的，要改变颜色可以在<code>/themes/next/layout/_partials/head.swig</code>文件中添加如下代码（接在刚才link的后面）</p>
<figure class="highlight"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></div><div class="code"><pre><div class="line">&lt;<span class="selector-tag">style</span>&gt;</div><div class="line">    <span class="selector-class">.pace</span> <span class="selector-class">.pace-progress</span> &#123;</div><div class="line">        <span class="attribute">background</span>: <span class="number">#1E92FB</span>; <span class="comment">/*进度条颜色*/</span></div><div class="line">        <span class="attribute">height</span>: <span class="number">3px</span>;</div><div class="line">    &#125;</div><div class="line">    <span class="selector-class">.pace</span> <span class="selector-class">.pace-progress-inner</span> &#123;</div><div class="line">         <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">0</span> <span class="number">10px</span> <span class="number">#1E92FB</span>, <span class="number">0</span> <span class="number">0</span> <span class="number">5px</span>     <span class="number">#1E92FB</span>; <span class="comment">/*阴影颜色*/</span></div><div class="line">    &#125;</div><div class="line">    <span class="selector-class">.pace</span> <span class="selector-class">.pace-activity</span> &#123;</div><div class="line">        <span class="attribute">border-top-color</span>: <span class="number">#1E92FB</span>;    <span class="comment">/*上边框颜色*/</span></div><div class="line">        <span class="attribute">border-left-color</span>: <span class="number">#1E92FB</span>;    <span class="comment">/*左边框颜色*/</span></div><div class="line">    &#125;</div><div class="line">&lt;/style&gt;</div></pre></div></div></figure>
<hr>
<h1 id="20-在文章底部增加版权信息-使用"><a href="#20-在文章底部增加版权信息-使用" class="headerlink" title="20. 在文章底部增加版权信息(使用)"></a>20. 在文章底部增加版权信息(使用)</h1><h3 id="实现效果图-12"><a href="#实现效果图-12" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="http://qn.codenote.pro/2018-09-28-21-19-18.png" alt="2018-09-28-21-19-18.png"><br>在目录 <code>next/layout/_macro/下</code>添加 <code>my-copyright.swig</code>：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div></pre></div><div class="code"><pre><div class="line">&#123;% if page.copyright %&#125;</div><div class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"my_post_copyright"</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"></div><div class="line">  <span class="comment">&lt;!-- JS库 sweetalert 可修改路径 --&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://unpkg.com/sweetalert/dist/sweetalert.min.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>本文标题:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"&#123;&#123; url_for(page.path) &#125;&#125;"</span>&gt;</span>&#123;&#123; page.title &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>文章作者:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"/"</span> <span class="attr">title</span>=<span class="string">"访问 &#123;&#123; theme.author &#125;&#125; 的个人博客"</span>&gt;</span>&#123;&#123; theme.author &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>发布时间:<span class="tag">&lt;/<span class="name">span</span>&gt;</span>&#123;&#123; page.date.format("YYYY年MM月DD日 - HH:MM") &#125;&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>最后更新:<span class="tag">&lt;/<span class="name">span</span>&gt;</span>&#123;&#123; page.updated.format("YYYY年MM月DD日 - HH:MM") &#125;&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>原始链接:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"&#123;&#123; url_for(page.path) &#125;&#125;"</span> <span class="attr">title</span>=<span class="string">"&#123;&#123; page.title &#125;&#125;"</span>&gt;</span>&#123;&#123; page.permalink &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"copy-path"</span>  <span class="attr">title</span>=<span class="string">"点击复制文章链接"</span>&gt;</span><span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-clipboard"</span> <span class="attr">data-clipboard-text</span>=<span class="string">"&#123;&#123; page.permalink &#125;&#125;"</span>  <span class="attr">aria-label</span>=<span class="string">"复制成功！"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>许可协议:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-creative-commons"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span> <span class="tag">&lt;<span class="name">a</span> <span class="attr">rel</span>=<span class="string">"license"</span> <span class="attr">href</span>=<span class="string">"https://creativecommons.org/licenses/by-nc-nd/4.0/"</span> <span class="attr">target</span>=<span class="string">"_blank"</span> <span class="attr">title</span>=<span class="string">"Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)"</span>&gt;</span>署名-非商业性使用-禁止演绎 4.0 国际<span class="tag">&lt;/<span class="name">a</span>&gt;</span> 转载请保留原文链接及作者。<span class="tag">&lt;/<span class="name">p</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></div><div class="line"><span class="javascript">    <span class="keyword">var</span> clipboard = <span class="keyword">new</span> Clipboard(<span class="string">'.fa-clipboard'</span>);</span></div><div class="line"><span class="javascript">      $(<span class="string">".fa-clipboard"</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span></div><div class="line"><span class="javascript">      clipboard.on(<span class="string">'success'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span></div><div class="line"><span class="undefined">        swal(&#123;</span></div><div class="line"><span class="javascript">          title: <span class="string">""</span>,</span></div><div class="line"><span class="javascript">          text: <span class="string">'复制成功'</span>,</span></div><div class="line"><span class="javascript">          icon: <span class="string">"success"</span>,</span></div><div class="line"><span class="javascript">          showConfirmButton: <span class="literal">true</span></span></div><div class="line"><span class="undefined">          &#125;);</span></div><div class="line"><span class="undefined">        &#125;);</span></div><div class="line"><span class="undefined">    &#125;);</span></div><div class="line"><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">&#123;% endif %&#125;</div></pre></div></div></figure>
<p>在目录<code>next/source/css/_common/components/post/</code>下添加<code>my-post-copyright.styl</code>：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div></pre></div><div class="code"><pre><div class="line"><span class="selector-class">.my_post_copyright</span> &#123;</div><div class="line">  <span class="attribute">width</span>: <span class="number">85%</span>;</div><div class="line">  <span class="attribute">max-width</span>: <span class="number">45em</span>;</div><div class="line">  <span class="attribute">margin</span>: <span class="number">2.8em</span> auto <span class="number">0</span>;</div><div class="line">  <span class="attribute">padding</span>: <span class="number">0.5em</span> <span class="number">1.0em</span>;</div><div class="line">  <span class="attribute">border</span>: <span class="number">1px</span> solid <span class="number">#d3d3d3</span>;</div><div class="line">  <span class="attribute">font-size</span>: <span class="number">0.93rem</span>;</div><div class="line">  <span class="attribute">line-height</span>: <span class="number">1.6em</span>;</div><div class="line">  <span class="attribute">word-break</span>: break-all;</div><div class="line">  <span class="attribute">background</span>: <span class="built_in">rgba</span>(255,255,255,0.4);</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">p</span>&#123;<span class="attribute">margin</span>:<span class="number">0</span>;&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">span</span> &#123;</div><div class="line">  <span class="attribute">display</span>: inline-block;</div><div class="line">  <span class="attribute">width</span>: <span class="number">5.2em</span>;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#b5b5b5</span>;</div><div class="line">  <span class="attribute">font-weight</span>: bold;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.raw</span> &#123;</div><div class="line">  <span class="attribute">margin-left</span>: <span class="number">1em</span>;</div><div class="line">  <span class="attribute">width</span>: <span class="number">5em</span>;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">a</span> &#123;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#808080</span>;</div><div class="line">  <span class="attribute">border-bottom</span>:<span class="number">0</span>;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">a</span><span class="selector-pseudo">:hover</span> &#123;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#a3d2a3</span>;</div><div class="line">  <span class="attribute">text-decoration</span>: underline;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span><span class="selector-pseudo">:hover</span> <span class="selector-class">.fa-clipboard</span> &#123;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#000</span>;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.post-url</span><span class="selector-pseudo">:hover</span> &#123;</div><div class="line">  <span class="attribute">font-weight</span>: normal;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.copy-path</span> &#123;</div><div class="line">  <span class="attribute">margin-left</span>: <span class="number">1em</span>;</div><div class="line">  <span class="attribute">width</span>: <span class="number">1em</span>;</div><div class="line">  +mobile()&#123;display:none;&#125;</div><div class="line">&#125;</div><div class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.copy-path</span><span class="selector-pseudo">:hover</span> &#123;</div><div class="line">  <span class="attribute">color</span>: <span class="number">#808080</span>;</div><div class="line">  <span class="attribute">cursor</span>: pointer;</div><div class="line">&#125;</div></pre></div></div></figure>
<p>修改<code>next/layout/_macro/post.swig</code>，在代码</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">div</span>&gt;</span></div><div class="line">      &#123;% if not is_index %&#125;</div><div class="line">        &#123;% include 'wechat-subscriber.swig' %&#125;</div><div class="line">      &#123;% endif %&#125;</div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div></pre></div></div></figure>
<p>之前添加增加如下代码：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">div</span>&gt;</span></div><div class="line">      &#123;% if not is_index %&#125;</div><div class="line">        &#123;% include 'my-copyright.swig' %&#125;</div><div class="line">      &#123;% endif %&#125;</div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div></pre></div></div></figure>
<p>如下：</p>
<p>修改<code>next/source/css/_common/components/post/post.styl</code>文件，在最后一行增加代码：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">@<span class="keyword">import</span> <span class="string">"my-post-copyright"</span></div></pre></div></div></figure>
<p>保存重新生成即可。<br>如果要在该博文下面增加版权信息的显示，需要在 Markdown 中增加<code>copyright: true</code>的设置，类似：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></div><div class="code"><pre><div class="line"><span class="meta">---</span></div><div class="line"><span class="attr">title:</span> <span class="string">前端小项目：使用canvas绘画哆啦A梦</span></div><div class="line"><span class="attr">date:</span> <span class="number">2017</span><span class="bullet">-05</span><span class="bullet">-22</span> <span class="number">22</span><span class="string">:53:53</span></div><div class="line"><span class="attr">tags:</span> <span class="string">canvas</span></div><div class="line"><span class="attr">categories:</span> <span class="string">前端</span></div><div class="line"><span class="attr">copyright:</span> <span class="literal">true</span></div><div class="line"><span class="meta">---</span></div></pre></div></div></figure>
<blockquote>
<p><strong>小技巧</strong>：如果你觉得每次都要输入<code>copyright: true</code>很麻烦的话,那么在<code>/scaffolds/post.md</code>文件中添加：</p>
<p>这样每次<code>hexo new &quot;你的内容&quot;</code>之后，生成的md文件会自动把<code>copyright:</code>加到里面去<br>(<strong>注意</strong>：如果解析出来之后，你的原始链接有问题：如：<code>http://yoursite.com/前端小项目：使用canvas绘画哆啦A梦.html</code>,那么在根目录下<code>_config.yml</code>中写成类似这样：）</p>
<p>就行了。</p>
</blockquote>
<hr>
<h1 id="21-添加来必力（NexT6-x版本自带）"><a href="#21-添加来必力（NexT6-x版本自带）" class="headerlink" title="21. 添加来必力（NexT6.x版本自带）"></a>21. 添加来必力（NexT6.x版本自带）</h1><p>首先在 <code>_config.yml</code> 文件中添加如下配置：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></div><div class="code"><pre><div class="line"><span class="comment"># Support for LiveRe comments system.</span></div><div class="line"><span class="comment"># You can get your uid from https://livere.com/insight/myCode (General web site)</span></div><div class="line"><span class="attr">livere_uid:</span> <span class="string">your</span> <span class="string">uid</span></div></pre></div></div></figure>
<p>其中，<code>livere_uid</code>就是画红线的部分</p>
<p>然后在 <code>layout/_scripts/third-party/comments/</code> 目录中添加 livere.swig，文件内容如下：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></div><div class="code"><pre><div class="line">&#123;% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname and not theme.disqus_shortname and not theme.hypercomments_id and not theme.gentie_productKey %&#125;</div><div class="line">  &#123;% if theme.livere_uid %&#125;</div><div class="line">    <span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span>&gt;</span><span class="undefined"></span></div><div class="line"><span class="javascript">      (<span class="function"><span class="keyword">function</span>(<span class="params">d, s</span>) </span>&#123;</span></div><div class="line"><span class="javascript">        <span class="keyword">var</span> j, e = d.getElementsByTagName(s)[<span class="number">0</span>];</span></div><div class="line"><span class="javascript">        <span class="keyword">if</span> (<span class="keyword">typeof</span> LivereTower === <span class="string">'function'</span>) &#123; <span class="keyword">return</span>; &#125;</span></div><div class="line"><span class="undefined">        j = d.createElement(s);</span></div><div class="line"><span class="javascript">        j.src = <span class="string">'https://cdn-city.livere.com/js/embed.dist.js'</span>;</span></div><div class="line"><span class="javascript">        j.async = <span class="literal">true</span>;</span></div><div class="line"><span class="undefined">        e.parentNode.insertBefore(j, e);</span></div><div class="line"><span class="javascript">      &#125;)(<span class="built_in">document</span>, <span class="string">'script'</span>);</span></div><div class="line"><span class="undefined">    </span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">  &#123;% endif %&#125;</div><div class="line">&#123;% endif %&#125;</div></pre></div></div></figure>
<p>然后在 <code>layout/_scripts/third-party/comments.swig</code>文件中追加：</p>
<figure class="highlight plain"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">&#123;% include &apos;./comments/livere.swig&apos; %&#125;</div></pre></div></div></figure>
<p>最后，在 <code>layout/_partials/comments.swig</code> 文件中条件最后追加 LiveRe 插件是否引用的判断逻辑：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></div><div class="code"><pre><div class="line">&#123;% elseif theme.livere_uid %&#125;</div><div class="line">      <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">"lv-container"</span> <span class="attr">data-id</span>=<span class="string">"city"</span> <span class="attr">data-uid</span>=<span class="string">"&#123;&#123; theme.livere_uid &#125;&#125;"</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">&#123;% endif %&#125;</div></pre></div></div></figure>
<p>完</p>
<hr>
<h1 id="22-隐藏网页底部powered-By-Hexo-强力驱动（NexT6-x版本自带）"><a href="#22-隐藏网页底部powered-By-Hexo-强力驱动（NexT6-x版本自带）" class="headerlink" title="22. 隐藏网页底部powered By Hexo / 强力驱动（NexT6.x版本自带）"></a>22. 隐藏网页底部powered By Hexo / 强力驱动（NexT6.x版本自带）</h1><p>打开<code>themes/next/layout/_partials/footer.swig</code>,使用””隐藏之间的代码即可，或者直接删除。位置如图：<br><img src="http://qn.codenote.pro/2018-09-28-21-25-02.png" alt="2018-09-28-21-25-02.png"></p>
<hr>
<h1 id="23-修改网页底部的桃心（未使用）"><a href="#23-修改网页底部的桃心（未使用）" class="headerlink" title="23. 修改网页底部的桃心（未使用）"></a>23. 修改网页底部的桃心（未使用）</h1><p>还是打开<code>themes/next/layout/_partials/footer.swig</code>，找到：<br><img src="http://qn.codenote.pro/2018-09-28-21-26-06.png" alt="2018-09-28-21-26-06.png"><br>，然后还是在<a href="http://fontawesome.io/icons/" rel="external nofollow noopener noreferrer" target="_blank">图标库</a>中找到你自己喜欢的图标，然后修改画红线的部分就可以了。</p>
<hr>
<h1 id="24-文章加密访问"><a href="#24-文章加密访问" class="headerlink" title="24. 文章加密访问"></a>24. 文章加密访问</h1><h3 id="实现效果图-13"><a href="#实现效果图-13" class="headerlink" title="实现效果图"></a>实现效果图</h3><p><img src="https://upload-images.jianshu.io/upload_images/5308475-0c7e5e61b78dc937.gif" alt="https://upload-images.jianshu.io/upload_images/5308475-0c7e5e61b78dc937.gif"></p>
<h3 id="具体实现方法-15"><a href="#具体实现方法-15" class="headerlink" title="具体实现方法"></a>具体实现方法</h3><p>打开<code>themes-&gt;next-&gt;layout-&gt;_partials-&gt;head.swig</code>文件,在以下位置插入这样一段代码：</p>
<p>代码如下：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></div><div class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></div><div class="line"><span class="javascript">    (<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span></div><div class="line"><span class="javascript">        <span class="keyword">if</span>(<span class="string">'&#123;&#123; page.password &#125;&#125;'</span>)&#123;</span></div><div class="line"><span class="javascript">            <span class="keyword">if</span> (prompt(<span class="string">'请输入文章密码'</span>) !== <span class="string">'&#123;&#123; page.password &#125;&#125;'</span>)&#123;</span></div><div class="line"><span class="javascript">                alert(<span class="string">'密码错误！'</span>);</span></div><div class="line"><span class="undefined">                history.back();</span></div><div class="line"><span class="undefined">            &#125;</span></div><div class="line"><span class="undefined">        &#125;</span></div><div class="line"><span class="undefined">    &#125;)();</span></div><div class="line"><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></div></div></figure>
<p>然后在文章上写成类似这样：<br><img src="http://qn.codenote.pro/2018-09-28-21-27-30.png" alt="2018-09-28-21-27-30.png"></p>
<hr>
<h1 id="25-添加jiathis分享（未使用）"><a href="#25-添加jiathis分享（未使用）" class="headerlink" title="25. 添加jiathis分享（未使用）"></a>25. 添加jiathis分享（未使用）</h1><p>在<strong>主题配置文件</strong>中，jiathis为true，就行了，如下图<br><img src="http://qn.codenote.pro/2018-09-28-21-31-08.png" alt="2018-09-28-21-31-08.png"><br>默认是这样子的：<br><img src="http://qn.codenote.pro/2018-09-28-21-31-21.png" alt="2018-09-28-21-31-21.png"></p>
<p>如果你想自定义话，打开<code>themes/next/layout/_partials/share/jiathis.swig</code>修改画红线部分就可以了<br><img src="http://qn.codenote.pro/2018-09-28-21-31-40.png" alt="2018-09-28-21-31-40.png"></p>
<hr>
<h1 id="26-博文置顶（未使用）"><a href="#26-博文置顶（未使用）" class="headerlink" title="26. 博文置顶（未使用）"></a>26. 博文置顶（未使用）</h1><p>修改 <code>hero-generator-index</code> 插件，把文件：<code>node_modules/hexo-generator-index/lib/generator.js</code> 内的代码替换为：</p>
<figure class="highlight js"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div></pre></div><div class="code"><pre><div class="line"><span class="meta">'use strict'</span>;</div><div class="line"><span class="keyword">var</span> pagination = <span class="built_in">require</span>(<span class="string">'hexo-pagination'</span>);</div><div class="line"><span class="built_in">module</span>.exports = <span class="function"><span class="keyword">function</span>(<span class="params">locals</span>)</span>&#123;</div><div class="line">  <span class="keyword">var</span> config = <span class="keyword">this</span>.config;</div><div class="line">  <span class="keyword">var</span> posts = locals.posts;</div><div class="line">    posts.data = posts.data.sort(<span class="function"><span class="keyword">function</span>(<span class="params">a, b</span>) </span>&#123;</div><div class="line">        <span class="keyword">if</span>(a.top &amp;&amp; b.top) &#123; <span class="comment">// 两篇文章top都有定义</span></div><div class="line">            <span class="keyword">if</span>(a.top == b.top) <span class="keyword">return</span> b.date - a.date; <span class="comment">// 若top值一样则按照文章日期降序排</span></div><div class="line">            <span class="keyword">else</span> <span class="keyword">return</span> b.top - a.top; <span class="comment">// 否则按照top值降序排</span></div><div class="line">        &#125;</div><div class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(a.top &amp;&amp; !b.top) &#123; <span class="comment">// 以下是只有一篇文章top有定义，那么将有top的排在前面（这里用异或操作居然不行233）</span></div><div class="line">            <span class="keyword">return</span> <span class="number">-1</span>;</div><div class="line">        &#125;</div><div class="line">        <span class="keyword">else</span> <span class="keyword">if</span>(!a.top &amp;&amp; b.top) &#123;</div><div class="line">            <span class="keyword">return</span> <span class="number">1</span>;</div><div class="line">        &#125;</div><div class="line">        <span class="keyword">else</span> <span class="keyword">return</span> b.date - a.date; <span class="comment">// 都没定义按照文章日期降序排</span></div><div class="line">    &#125;);</div><div class="line">  <span class="keyword">var</span> paginationDir = config.pagination_dir || <span class="string">'page'</span>;</div><div class="line">  <span class="keyword">return</span> pagination(<span class="string">''</span>, posts, &#123;</div><div class="line">    perPage: config.index_generator.per_page,</div><div class="line">    layout: [<span class="string">'index'</span>, <span class="string">'archive'</span>],</div><div class="line">    format: paginationDir + <span class="string">'/%d/'</span>,</div><div class="line">    data: &#123;</div><div class="line">      __index: <span class="literal">true</span></div><div class="line">    &#125;</div><div class="line">  &#125;);</div><div class="line">&#125;;</div></pre></div></div></figure>
<p>在文章中添加 <code>top</code> 值，数值越大文章越靠前，如</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></div><div class="code"><pre><div class="line"><span class="meta">---</span></div><div class="line"><span class="attr">title:</span> <span class="string">解决Charles乱码问题</span></div><div class="line"><span class="attr">date:</span> <span class="number">2017</span><span class="bullet">-05</span><span class="bullet">-22</span> <span class="number">22</span><span class="string">:45:48</span></div><div class="line"><span class="attr">tags:</span> <span class="string">技巧</span></div><div class="line"><span class="attr">categories:</span> <span class="string">技巧</span></div><div class="line"><span class="attr">copyright:</span> <span class="literal">true</span></div><div class="line"><span class="attr">top:</span> <span class="number">100</span></div><div class="line"><span class="meta">---</span></div></pre></div></div></figure>
<hr>
<h1 id="27-修改字体大小"><a href="#27-修改字体大小" class="headerlink" title="27. 修改字体大小"></a>27. 修改字体大小</h1><p>打开<code>\themes\next\source\css\ _variables\base.styl</code>文件，将<code>$font-size-base</code>改成<code>16px</code>，如下所示：</p>
<figure class="highlight"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">$font-size-base            =16px</div></pre></div></div></figure>
<hr>
<h1 id="28-修改打赏字体不闪动（未使用）"><a href="#28-修改打赏字体不闪动（未使用）" class="headerlink" title="28. 修改打赏字体不闪动（未使用）"></a>28. 修改打赏字体不闪动（未使用）</h1><p>修改文件<code>next/source/css/_common/components/post/post-reward.styl</code>，然后注释其中的函数<code>wechat:hover</code>和<code>alipay:hover</code>，如下：</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></div><div class="code"><pre><div class="line"><span class="comment">/* 注释文字闪动函数</span></div><div class="line"><span class="comment"> #wechat:hover p&#123;</span></div><div class="line"><span class="comment">    animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">    -webkit-animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">    -moz-animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">&#125;</span></div><div class="line"><span class="comment"> #alipay:hover p&#123;</span></div><div class="line"><span class="comment">   animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">    -webkit-animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">    -moz-animation: roll 0.1s infinite linear;</span></div><div class="line"><span class="comment">&#125;</span></div><div class="line"><span class="comment">*/</span></div></pre></div></div></figure>
<h1 id="29-自定义鼠标样式（未使用）"><a href="#29-自定义鼠标样式（未使用）" class="headerlink" title="29. 自定义鼠标样式（未使用）"></a>29. 自定义鼠标样式（未使用）</h1><p>打开<code>themes/next/source/css/_custom/custom.styl</code>,在里面写下如下代码</p>
<figure class="highlight css"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></div><div class="code"><pre><div class="line">// 鼠标样式</div><div class="line">  * &#123;</div><div class="line">      <span class="attribute">cursor</span>: <span class="built_in">url</span>(<span class="string">"http://om8u46rmb.bkt.clouddn.com/sword2.ico"</span>),auto<span class="meta">!important</span></div><div class="line">  &#125;</div><div class="line">  <span class="selector-pseudo">:active</span> &#123;</div><div class="line">      <span class="attribute">cursor</span>: <span class="built_in">url</span>(<span class="string">"http://om8u46rmb.bkt.clouddn.com/sword1.ico"</span>),auto<span class="meta">!important</span></div><div class="line">  &#125;</div></pre></div></div></figure>
<p>其中 url 里面必须是 ico 图片，ico 图片可以上传到网上（我是使用七牛云图床），然后获取外链，复制到 url 里就行了</p>
<hr>
<h1 id="30-为博客加上萌萌的宠物（未使用）"><a href="#30-为博客加上萌萌的宠物（未使用）" class="headerlink" title="30.为博客加上萌萌的宠物（未使用）"></a>30.为博客加上萌萌的宠物（未使用）</h1><p><strong>实现效果图</strong><br><img src="http://qn.codenote.pro/2018-09-28-21-37-32.png" alt="2018-09-28-21-37-32.png"><br><strong>具体实现方法</strong><br>在终端切换到你的博客的路径里，然后输入如下代码：</p>
<figure class="highlight bash"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">npm install -save hexo-helper-live2d</div></pre></div></div></figure>
<p><del>然后打开<code>Hexo/blog/themes/next/layout</code><br>的<code>_layout.swig</code>,将下面代码放到<code>&lt;/body&gt;</code>之前：</del><br><strong>(注意，由于官方更新了包，所以画删除线的不用弄)</strong></p>
<p>然后在在 <code>hexo</code> 的 <code>_config.yml</code>中添加参数：（具体配置可以参考<a href="https://github.com/EYHN/hexo-helper-live2d" rel="external nofollow noopener noreferrer" target="_blank">文档</a>）</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></div><div class="code"><pre><div class="line"><span class="attr">live2d:</span></div><div class="line"><span class="attr">  enable:</span> <span class="literal">true</span></div><div class="line"><span class="attr">  scriptFrom:</span> <span class="string">local</span></div><div class="line"><span class="attr">  pluginRootPath:</span> <span class="string">live2dw/</span></div><div class="line"><span class="attr">  pluginJsPath:</span> <span class="string">lib/</span></div><div class="line"><span class="attr">  pluginModelPath:</span> <span class="string">assets/</span></div><div class="line"><span class="attr">  model:</span></div><div class="line"><span class="attr">    use:</span> <span class="string">live2d-widget-model-wanko</span></div><div class="line"><span class="attr">  display:</span></div><div class="line"><span class="attr">    position:</span> <span class="string">right</span></div><div class="line"><span class="attr">    width:</span> <span class="number">150</span></div><div class="line"><span class="attr">    height:</span> <span class="number">300</span></div><div class="line"><span class="attr">  mobile:</span></div><div class="line"><span class="attr">    show:</span> <span class="literal">true</span></div></pre></div></div></figure>
<p>然后<code>hexo clean ，hexo g ，hexo d</code>就可以看到了。</p>
<blockquote>
<p>注意！如果你在 hexo d 的时候出现我下面这个问题<br><img src="http://qn.codenote.pro/2018-09-28-21-39-30.png" alt="2018-09-28-21-39-30.png"></p>
</blockquote>
<blockquote>
<p>你可以这样，首先删除hexo 下面的.deploy_git文件夹，然后运行</p>
</blockquote>
<figure class="highlight bash"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line">git config --global core.autocrlf <span class="literal">false</span></div></pre></div></div></figure>
<blockquote>
<p>重新 hexo clean,hexo g,hexo d就行了</p>
</blockquote>
<hr>
<h1 id="31-DaoVoice-在线联系（未使用）"><a href="#31-DaoVoice-在线联系（未使用）" class="headerlink" title="31.DaoVoice 在线联系（未使用）"></a>31.DaoVoice 在线联系（未使用）</h1><p><strong>实现效果图</strong><br><img src="http://qn.codenote.pro/2018-09-28-21-39-53.png" alt="2018-09-28-21-39-53.png"><br><strong>具体实现方法</strong></p>
<p>首先在 <a href="https://account.daocloud.io/signin" rel="external nofollow noopener noreferrer" target="_blank">daovoice</a> 注册账号,注册完成后会得到一个 app_id :</p>
<p>记下这个 app_id的值，然后打开<code>/themes/next/layout/_partials/head.swig</code>,写下如下代码：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></div><div class="code"><pre><div class="line">&#123;% if theme.daovoice %&#125;</div><div class="line">  <span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></div><div class="line"><span class="javascript">  (<span class="function"><span class="keyword">function</span>(<span class="params">i,s,o,g,r,a,m</span>)</span>&#123;i[<span class="string">"DaoVoiceObject"</span>]=r;i[r]=i[r]||<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;(i[r].q=i[r].q||[]).push(<span class="built_in">arguments</span>)&#125;,i[r].l=<span class="number">1</span>*<span class="keyword">new</span> <span class="built_in">Date</span>();a=s.createElement(o),m=s.getElementsByTagName(o)[<span class="number">0</span>];a.async=<span class="number">1</span>;a.src=g;a.charset=<span class="string">"utf-8"</span>;m.parentNode.insertBefore(a,m)&#125;)(<span class="built_in">window</span>,<span class="built_in">document</span>,<span class="string">"script"</span>,(<span class="string">'https:'</span> == <span class="built_in">document</span>.location.protocol ? <span class="string">'https:'</span> : <span class="string">'http:'</span>) + <span class="string">"//widget.daovoice.io/widget/0f81ff2f.js"</span>,<span class="string">"daovoice"</span>)</span></div><div class="line"><span class="javascript">  daovoice(<span class="string">'init'</span>, &#123;</span></div><div class="line"><span class="javascript">      app_id: <span class="string">"&#123;&#123;theme.daovoice_app_id&#125;&#125;"</span></span></div><div class="line"><span class="undefined">    &#125;);</span></div><div class="line"><span class="javascript">  daovoice(<span class="string">'update'</span>);</span></div><div class="line"><span class="undefined">  </span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">&#123;% endif %&#125;</div></pre></div></div></figure>
<p>接着打开<strong>主题配置文件</strong>，在最后写下如下代码：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></div><div class="code"><pre><div class="line"><span class="comment"># Online contact</span></div><div class="line"><span class="attr">daovoice:</span> <span class="literal">true</span></div><div class="line"></div><div class="line"><span class="attr">daovoice_app_id:</span> <span class="string">这里填你的刚才获得的</span> <span class="string">app_id</span></div></pre></div></div></figure>
<p>重新 <code>hexo g ，hexo s</code> 就能看到效果了。</p>
<blockquote>
<p>安装成功后可以在DaoVoice 控制台上的聊天设置里设置聊天窗口样式，附上我的设置<br><img src="http://qn.codenote.pro/2018-09-28-21-41-07.png" alt="2018-09-28-21-41-07.png"></p>
</blockquote>
<hr>
<h1 id="32-点击爆炸效果（未使用）"><a href="#32-点击爆炸效果（未使用）" class="headerlink" title="32.点击爆炸效果（未使用）"></a>32.点击爆炸效果（未使用）</h1><p><strong>实现效果图</strong><br><img src="http://qn.codenote.pro/2018-09-28-21-41-23.png" alt="2018-09-28-21-41-23.png"><br><strong>实现方法</strong></p>
<p>跟那个红心是差不多的，首先在<code>themes/next/source/js/src</code>里面建一个叫<code>fireworks.js</code>的文件，代码如下：</p>
<figure class="highlight js"><div class="figcode"><div class="gutter"><pre><div class="line">1</div></pre></div><div class="code"><pre><div class="line"><span class="meta">"use strict"</span>;<span class="function"><span class="keyword">function</span> <span class="title">updateCoords</span>(<span class="params">e</span>)</span>&#123;pointerX=(e.clientX||e.touches[<span class="number">0</span>].clientX)-canvasEl.getBoundingClientRect().left,pointerY=e.clientY||e.touches[<span class="number">0</span>].clientY-canvasEl.getBoundingClientRect().top&#125;<span class="function"><span class="keyword">function</span> <span class="title">setParticuleDirection</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> t=anime.random(<span class="number">0</span>,<span class="number">360</span>)*<span class="built_in">Math</span>.PI/<span class="number">180</span>,a=anime.random(<span class="number">50</span>,<span class="number">180</span>),n=[<span class="number">-1</span>,<span class="number">1</span>][anime.random(<span class="number">0</span>,<span class="number">1</span>)]*a;<span class="keyword">return</span>&#123;<span class="attr">x</span>:e.x+n*<span class="built_in">Math</span>.cos(t),<span class="attr">y</span>:e.y+n*<span class="built_in">Math</span>.sin(t)&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">createParticule</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a=&#123;&#125;;<span class="keyword">return</span> a.x=e,a.y=t,a.color=colors[anime.random(<span class="number">0</span>,colors.length<span class="number">-1</span>)],a.radius=anime.random(<span class="number">16</span>,<span class="number">32</span>),a.endPos=setParticuleDirection(a),a.draw=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,<span class="number">0</span>,<span class="number">2</span>*<span class="built_in">Math</span>.PI,!<span class="number">0</span>),ctx.fillStyle=a.color,ctx.fill()&#125;,a&#125;<span class="function"><span class="keyword">function</span> <span class="title">createCircle</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a=&#123;&#125;;<span class="keyword">return</span> a.x=e,a.y=t,a.color=<span class="string">"#F00"</span>,a.radius=<span class="number">0.1</span>,a.alpha=<span class="number">0.5</span>,a.lineWidth=<span class="number">6</span>,a.draw=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.globalAlpha=a.alpha,ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,<span class="number">0</span>,<span class="number">2</span>*<span class="built_in">Math</span>.PI,!<span class="number">0</span>),ctx.lineWidth=a.lineWidth,ctx.strokeStyle=a.color,ctx.stroke(),ctx.globalAlpha=<span class="number">1</span>&#125;,a&#125;<span class="function"><span class="keyword">function</span> <span class="title">renderParticule</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> t=<span class="number">0</span>;t&lt;e.animatables.length;t++)&#123;e.animatables[t].target.draw()&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">animateParticules</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> a=createCircle(e,t),n=[],i=<span class="number">0</span>;i&lt;numberOfParticules;i++)&#123;n.push(createParticule(e,t))&#125;anime.timeline().add(&#123;<span class="attr">targets</span>:n,<span class="attr">x</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">return</span> e.endPos.x&#125;,<span class="attr">y</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">return</span> e.endPos.y&#125;,<span class="attr">radius</span>:<span class="number">0.1</span>,<span class="attr">duration</span>:anime.random(<span class="number">1200</span>,<span class="number">1800</span>),<span class="attr">easing</span>:<span class="string">"easeOutExpo"</span>,<span class="attr">update</span>:renderParticule&#125;).add(&#123;<span class="attr">targets</span>:a,<span class="attr">radius</span>:anime.random(<span class="number">80</span>,<span class="number">160</span>),<span class="attr">lineWidth</span>:<span class="number">0</span>,<span class="attr">alpha</span>:&#123;<span class="attr">value</span>:<span class="number">0</span>,<span class="attr">easing</span>:<span class="string">"linear"</span>,<span class="attr">duration</span>:anime.random(<span class="number">600</span>,<span class="number">800</span>)&#125;,<span class="attr">duration</span>:anime.random(<span class="number">1200</span>,<span class="number">1800</span>),<span class="attr">easing</span>:<span class="string">"easeOutExpo"</span>,<span class="attr">update</span>:renderParticule,<span class="attr">offset</span>:<span class="number">0</span>&#125;)&#125;<span class="function"><span class="keyword">function</span> <span class="title">debounce</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a;<span class="keyword">return</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;<span class="keyword">var</span> n=<span class="keyword">this</span>,i=<span class="built_in">arguments</span>;clearTimeout(a),a=setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;e.apply(n,i)&#125;,t)&#125;&#125;<span class="keyword">var</span> canvasEl=<span class="built_in">document</span>.querySelector(<span class="string">".fireworks"</span>);<span class="keyword">if</span>(canvasEl)&#123;<span class="keyword">var</span> ctx=canvasEl.getContext(<span class="string">"2d"</span>),numberOfParticules=<span class="number">30</span>,pointerX=<span class="number">0</span>,pointerY=<span class="number">0</span>,tap=<span class="string">"mousedown"</span>,colors=[<span class="string">"#FF1461"</span>,<span class="string">"#18FF92"</span>,<span class="string">"#5A87FF"</span>,<span class="string">"#FBF38C"</span>],setCanvasSize=debounce(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;canvasEl.width=<span class="number">2</span>*<span class="built_in">window</span>.innerWidth,canvasEl.height=<span class="number">2</span>*<span class="built_in">window</span>.innerHeight,canvasEl.style.width=<span class="built_in">window</span>.innerWidth+<span class="string">"px"</span>,canvasEl.style.height=<span class="built_in">window</span>.innerHeight+<span class="string">"px"</span>,canvasEl.getContext(<span class="string">"2d"</span>).scale(<span class="number">2</span>,<span class="number">2</span>)&#125;,<span class="number">500</span>),render=anime(&#123;<span class="attr">duration</span>:<span class="number">1</span>/<span class="number">0</span>,<span class="attr">update</span>:<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.clearRect(<span class="number">0</span>,<span class="number">0</span>,canvasEl.width,canvasEl.height)&#125;&#125;);<span class="built_in">document</span>.addEventListener(tap,<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="string">"sidebar"</span>!==e.target.id&amp;&amp;<span class="string">"toggle-sidebar"</span>!==e.target.id&amp;&amp;<span class="string">"A"</span>!==e.target.nodeName&amp;&amp;<span class="string">"IMG"</span>!==e.target.nodeName&amp;&amp;(render.play(),updateCoords(e),animateParticules(pointerX,pointerY))&#125;,!<span class="number">1</span>),setCanvasSize(),<span class="built_in">window</span>.addEventListener(<span class="string">"resize"</span>,setCanvasSize,!<span class="number">1</span>)&#125;<span class="string">"use strict"</span>;<span class="function"><span class="keyword">function</span> <span class="title">updateCoords</span>(<span class="params">e</span>)</span>&#123;pointerX=(e.clientX||e.touches[<span class="number">0</span>].clientX)-canvasEl.getBoundingClientRect().left,pointerY=e.clientY||e.touches[<span class="number">0</span>].clientY-canvasEl.getBoundingClientRect().top&#125;<span class="function"><span class="keyword">function</span> <span class="title">setParticuleDirection</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> t=anime.random(<span class="number">0</span>,<span class="number">360</span>)*<span class="built_in">Math</span>.PI/<span class="number">180</span>,a=anime.random(<span class="number">50</span>,<span class="number">180</span>),n=[<span class="number">-1</span>,<span class="number">1</span>][anime.random(<span class="number">0</span>,<span class="number">1</span>)]*a;<span class="keyword">return</span>&#123;<span class="attr">x</span>:e.x+n*<span class="built_in">Math</span>.cos(t),<span class="attr">y</span>:e.y+n*<span class="built_in">Math</span>.sin(t)&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">createParticule</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a=&#123;&#125;;<span class="keyword">return</span> a.x=e,a.y=t,a.color=colors[anime.random(<span class="number">0</span>,colors.length<span class="number">-1</span>)],a.radius=anime.random(<span class="number">16</span>,<span class="number">32</span>),a.endPos=setParticuleDirection(a),a.draw=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,<span class="number">0</span>,<span class="number">2</span>*<span class="built_in">Math</span>.PI,!<span class="number">0</span>),ctx.fillStyle=a.color,ctx.fill()&#125;,a&#125;<span class="function"><span class="keyword">function</span> <span class="title">createCircle</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a=&#123;&#125;;<span class="keyword">return</span> a.x=e,a.y=t,a.color=<span class="string">"#F00"</span>,a.radius=<span class="number">0.1</span>,a.alpha=<span class="number">0.5</span>,a.lineWidth=<span class="number">6</span>,a.draw=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.globalAlpha=a.alpha,ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,<span class="number">0</span>,<span class="number">2</span>*<span class="built_in">Math</span>.PI,!<span class="number">0</span>),ctx.lineWidth=a.lineWidth,ctx.strokeStyle=a.color,ctx.stroke(),ctx.globalAlpha=<span class="number">1</span>&#125;,a&#125;<span class="function"><span class="keyword">function</span> <span class="title">renderParticule</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> t=<span class="number">0</span>;t&lt;e.animatables.length;t++)&#123;e.animatables[t].target.draw()&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">animateParticules</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> a=createCircle(e,t),n=[],i=<span class="number">0</span>;i&lt;numberOfParticules;i++)&#123;n.push(createParticule(e,t))&#125;anime.timeline().add(&#123;<span class="attr">targets</span>:n,<span class="attr">x</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">return</span> e.endPos.x&#125;,<span class="attr">y</span>:<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">return</span> e.endPos.y&#125;,<span class="attr">radius</span>:<span class="number">0.1</span>,<span class="attr">duration</span>:anime.random(<span class="number">1200</span>,<span class="number">1800</span>),<span class="attr">easing</span>:<span class="string">"easeOutExpo"</span>,<span class="attr">update</span>:renderParticule&#125;).add(&#123;<span class="attr">targets</span>:a,<span class="attr">radius</span>:anime.random(<span class="number">80</span>,<span class="number">160</span>),<span class="attr">lineWidth</span>:<span class="number">0</span>,<span class="attr">alpha</span>:&#123;<span class="attr">value</span>:<span class="number">0</span>,<span class="attr">easing</span>:<span class="string">"linear"</span>,<span class="attr">duration</span>:anime.random(<span class="number">600</span>,<span class="number">800</span>)&#125;,<span class="attr">duration</span>:anime.random(<span class="number">1200</span>,<span class="number">1800</span>),<span class="attr">easing</span>:<span class="string">"easeOutExpo"</span>,<span class="attr">update</span>:renderParticule,<span class="attr">offset</span>:<span class="number">0</span>&#125;)&#125;<span class="function"><span class="keyword">function</span> <span class="title">debounce</span>(<span class="params">e,t</span>)</span>&#123;<span class="keyword">var</span> a;<span class="keyword">return</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;<span class="keyword">var</span> n=<span class="keyword">this</span>,i=<span class="built_in">arguments</span>;clearTimeout(a),a=setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;e.apply(n,i)&#125;,t)&#125;&#125;<span class="keyword">var</span> canvasEl=<span class="built_in">document</span>.querySelector(<span class="string">".fireworks"</span>);<span class="keyword">if</span>(canvasEl)&#123;<span class="keyword">var</span> ctx=canvasEl.getContext(<span class="string">"2d"</span>),numberOfParticules=<span class="number">30</span>,pointerX=<span class="number">0</span>,pointerY=<span class="number">0</span>,tap=<span class="string">"mousedown"</span>,colors=[<span class="string">"#FF1461"</span>,<span class="string">"#18FF92"</span>,<span class="string">"#5A87FF"</span>,<span class="string">"#FBF38C"</span>],setCanvasSize=debounce(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;canvasEl.width=<span class="number">2</span>*<span class="built_in">window</span>.innerWidth,canvasEl.height=<span class="number">2</span>*<span class="built_in">window</span>.innerHeight,canvasEl.style.width=<span class="built_in">window</span>.innerWidth+<span class="string">"px"</span>,canvasEl.style.height=<span class="built_in">window</span>.innerHeight+<span class="string">"px"</span>,canvasEl.getContext(<span class="string">"2d"</span>).scale(<span class="number">2</span>,<span class="number">2</span>)&#125;,<span class="number">500</span>),render=anime(&#123;<span class="attr">duration</span>:<span class="number">1</span>/<span class="number">0</span>,<span class="attr">update</span>:<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;ctx.clearRect(<span class="number">0</span>,<span class="number">0</span>,canvasEl.width,canvasEl.height)&#125;&#125;);<span class="built_in">document</span>.addEventListener(tap,<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="string">"sidebar"</span>!==e.target.id&amp;&amp;<span class="string">"toggle-sidebar"</span>!==e.target.id&amp;&amp;<span class="string">"A"</span>!==e.target.nodeName&amp;&amp;<span class="string">"IMG"</span>!==e.target.nodeName&amp;&amp;(render.play(),updateCoords(e),animateParticules(pointerX,pointerY))&#125;,!<span class="number">1</span>),setCanvasSize(),<span class="built_in">window</span>.addEventListener(<span class="string">"resize"</span>,setCanvasSize,!<span class="number">1</span>)&#125;;</div></pre></div></div></figure>
<p>打开<code>themes/next/layout/_layout.swig</code>,在<code>&lt;/body&gt;</code>上面写下如下代码：</p>
<figure class="highlight html"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></div><div class="code"><pre><div class="line">&#123;% if theme.fireworks %&#125;</div><div class="line">   <span class="tag">&lt;<span class="name">canvas</span> <span class="attr">class</span>=<span class="string">"fireworks"</span> <span class="attr">style</span>=<span class="string">"position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"</span> &gt;</span><span class="tag">&lt;/<span class="name">canvas</span>&gt;</span></div><div class="line">   <span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"//cdn.bootcss.com/animejs/2.2.0/anime.min.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">   <span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"/js/src/fireworks.js"</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line">&#123;% endif %&#125;</div></pre></div></div></figure>
<p>打开主题配置文件，在里面最后写下：</p>
<figure class="highlight yml"><div class="figcode"><div class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></div><div class="code"><pre><div class="line"><span class="comment"># Fireworks</span></div><div class="line"><span class="attr">fireworks:</span> <span class="literal">true</span></div></pre></div></div></figure>
<p>完😀</p>

      
    </div>

    
      


    

    
    
    
    
    <div>
        
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>
        
    </div>
    
    <div>
          
            
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>
  
  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/next-theme-personalization.html">Next主题个性化设置</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 yszar 的个人博客">yszar</a></p>
  <p><span>发布时间:</span>2018年09月28日 - 20:09</p>
  <p><span>最后更新:</span>2018年11月02日 - 00:11</p>
  <p><span>原始链接:</span><a href="/next-theme-personalization.html" title="Next主题个性化设置">https://blog.codenote.pro/next-theme-personalization.html</a>
    <span class="copy-path" title="点击复制文章链接"><i class="fas fa-copy" data-clipboard-text="https://blog.codenote.pro/next-theme-personalization.html" aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
      $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
        });
    });  
</script>


          
    </div>

    
      <div>
        <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/uploads/wechat-qcode.jpg" alt="yszar wechat" style="width: 200px; max-width: 100%;">
    <div>欢迎您扫一扫上面的微信公众号，订阅我的博客！</div>
</div>

      </div>
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wxfk.png" alt="yszar 微信支付">
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/zfbfk.png" alt="yszar 支付宝">
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Hexo/" rel="tag"><i class="fa fa-tag"></i> Hexo</a>
          
            <a href="/tags/Next主题/" rel="tag"><i class="fa fa-tag"></i> Next主题</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        
          <div class="wp_rating">
          <div style="color: rgba(0, 0, 0, 0.75); font-size:13px; letter-spacing:3px">(&gt;看完记得五星好评哦亲&lt;)</div>
            <div id="wpac-rating"></div>
          </div>
        

        

        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
            
              
              <a href="/set-the-access-count-display-for-next-theme.html" rel="prev" title="为Next主题设置访问次数显示">
                
                <i class="fa fa-chevron-left"></i> 为Next主题设置访问次数显示
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
            
              
              <a href="/hexomarkdown-concise-grammar-manual.html" rel="next" title="Hexo-Markdown简明语法手册">
                
                Hexo-Markdown简明语法手册 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  
       <div id="gitalk-container"></div>
       <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">yszar</p>
              <p class="site-description motion-element" itemprop="description">学无止境！</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">21</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">5</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">42</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/yszar" target="_blank" title="GitHub" rel="external nofollow noopener noreferrer"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="mailto:yszar@vip.qq.com" target="_blank" title="E-Mail" rel="external nofollow noopener noreferrer"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  
                </span>
              
            </div>
          

          
          
            <div class="cc-license motion-element" itemprop="license">
              <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank" rel="external nofollow noopener noreferrer">
                <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons">
              </a>
            </div>
          

          
          

          
            
          
          
        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-在右上角或者左上角实现fork-me-on-github"><span class="nav-number">1.</span> <span class="nav-text">1. 在右上角或者左上角实现fork me on github</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图"><span class="nav-number">1.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法"><span class="nav-number">1.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li></ol><li class="nav-item nav-level-1"><a class="nav-link" href="#2-添加RSS"><span class="nav-number">2.</span> <span class="nav-text">2.添加RSS</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-1"><span class="nav-number">2.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-1"><span class="nav-number">2.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-添加动态背景-未使用"><span class="nav-number">3.</span> <span class="nav-text">3. 添加动态背景(未使用)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-2"><span class="nav-number">3.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-2"><span class="nav-number">3.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#4-实现点击出现桃心效果-未使用"><span class="nav-number">4.</span> <span class="nav-text">4. 实现点击出现桃心效果(未使用)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-3"><span class="nav-number">4.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-3"><span class="nav-number">4.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#5-修改文章内链接文本样式（未使用）"><span class="nav-number">5.</span> <span class="nav-text">5. 修改文章内链接文本样式（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-4"><span class="nav-number">5.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-4"><span class="nav-number">5.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#6-修改文章底部的那个带-号的标签"><span class="nav-number">6.</span> <span class="nav-text">6. 修改文章底部的那个带#号的标签</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-5"><span class="nav-number">6.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-5"><span class="nav-number">6.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#7-在每篇文章末尾统一添加“本文结束”标记（未使用）"><span class="nav-number">7.</span> <span class="nav-text">7. 在每篇文章末尾统一添加“本文结束”标记（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-6"><span class="nav-number">7.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-6"><span class="nav-number">7.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#8-修改作者头像并旋转：-未使用"><span class="nav-number">8.</span> <span class="nav-text">8. 修改作者头像并旋转：(未使用)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-7"><span class="nav-number">8.0.1.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#9-博文压缩-未使用"><span class="nav-number">9.</span> <span class="nav-text">9. 博文压缩(未使用)</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#10-修改代码块自定义样式（未使用）"><span class="nav-number">10.</span> <span class="nav-text">10. 修改代码块自定义样式（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-8"><span class="nav-number">10.0.1.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#11-侧边栏社交小图标设置"><span class="nav-number">11.</span> <span class="nav-text">11. 侧边栏社交小图标设置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-7"><span class="nav-number">11.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-9"><span class="nav-number">11.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#12-主页文章添加阴影效果（未使用）"><span class="nav-number">12.</span> <span class="nav-text">12. 主页文章添加阴影效果（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-8"><span class="nav-number">12.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-10"><span class="nav-number">12.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#13-在网站底部加上访问量（未使用）"><span class="nav-number">13.</span> <span class="nav-text">13. 在网站底部加上访问量（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-9"><span class="nav-number">13.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-11"><span class="nav-number">13.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#14-添加热度（未使用）"><span class="nav-number">14.</span> <span class="nav-text">14. 添加热度（未使用）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图："><span class="nav-number">14.0.1.</span> <span class="nav-text">实现效果图：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-12"><span class="nav-number">14.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#15-网站底部字数统计"><span class="nav-number">15.</span> <span class="nav-text">15. 网站底部字数统计</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-10"><span class="nav-number">15.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体方法实现"><span class="nav-number">15.0.2.</span> <span class="nav-text">具体方法实现</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#16-添加-README-md-文件"><span class="nav-number">16.</span> <span class="nav-text">16. 添加 README.md 文件</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#17-设置网站的图标Favicon"><span class="nav-number">17.</span> <span class="nav-text">17. 设置网站的图标Favicon</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#具体方法实现-1"><span class="nav-number">17.0.1.</span> <span class="nav-text">具体方法实现</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#18-实现统计功能"><span class="nav-number">18.</span> <span class="nav-text">18. 实现统计功能</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-11"><span class="nav-number">18.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-13"><span class="nav-number">18.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#19-添加顶部加载条-NexT6-x版本自带"><span class="nav-number">19.</span> <span class="nav-text">19. 添加顶部加载条(NexT6.x版本自带)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-14"><span class="nav-number">19.0.1.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#20-在文章底部增加版权信息-使用"><span class="nav-number">20.</span> <span class="nav-text">20. 在文章底部增加版权信息(使用)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-12"><span class="nav-number">20.0.1.</span> <span class="nav-text">实现效果图</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#21-添加来必力（NexT6-x版本自带）"><span class="nav-number">21.</span> <span class="nav-text">21. 添加来必力（NexT6.x版本自带）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#22-隐藏网页底部powered-By-Hexo-强力驱动（NexT6-x版本自带）"><span class="nav-number">22.</span> <span class="nav-text">22. 隐藏网页底部powered By Hexo / 强力驱动（NexT6.x版本自带）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#23-修改网页底部的桃心（未使用）"><span class="nav-number">23.</span> <span class="nav-text">23. 修改网页底部的桃心（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#24-文章加密访问"><span class="nav-number">24.</span> <span class="nav-text">24. 文章加密访问</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实现效果图-13"><span class="nav-number">24.0.1.</span> <span class="nav-text">实现效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#具体实现方法-15"><span class="nav-number">24.0.2.</span> <span class="nav-text">具体实现方法</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#25-添加jiathis分享（未使用）"><span class="nav-number">25.</span> <span class="nav-text">25. 添加jiathis分享（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#26-博文置顶（未使用）"><span class="nav-number">26.</span> <span class="nav-text">26. 博文置顶（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#27-修改字体大小"><span class="nav-number">27.</span> <span class="nav-text">27. 修改字体大小</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#28-修改打赏字体不闪动（未使用）"><span class="nav-number">28.</span> <span class="nav-text">28. 修改打赏字体不闪动（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#29-自定义鼠标样式（未使用）"><span class="nav-number">29.</span> <span class="nav-text">29. 自定义鼠标样式（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#30-为博客加上萌萌的宠物（未使用）"><span class="nav-number">30.</span> <span class="nav-text">30.为博客加上萌萌的宠物（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#31-DaoVoice-在线联系（未使用）"><span class="nav-number">31.</span> <span class="nav-text">31.DaoVoice 在线联系（未使用）</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#32-点击爆炸效果（未使用）"><span class="nav-number">32.</span> <span class="nav-text">32.点击爆炸效果（未使用）</span></a></li></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  
  <span class="with-love" id="heart">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">yszar</span>

  

  
</div>


  










<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共38.6k字</span>
</div>
<div class="post-count">
	<a href="http://www.miitbeian.gov.cn/" rel="external nofollow noopener noreferrer" target="_blank">陇ICP备15003024号</a>
</div>


<div class="weixin-box">
  <div class="weixin-menu">
    <div class="weixin-hover">
      <div class="weixin-description">微信扫一扫，订阅本博客</div>
    </div>
  </div>
</div>
        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    
	
    

    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>












  















  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery@2.1.3/dist/jquery.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.pack.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.4.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.4.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.4.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.4.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.4.2"></script>



  



  










   
     
       <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>

      <script src="/js/src/md5.min.js"></script>

       <script type="text/javascript">
         const gitalk = new Gitalk({
           clientID: '54f26977793794b45255',
           clientSecret: '568cccb3bdde42eca6c05ab0680b4617bbb58c4f',
           repo: 'yszar.github.io',
           owner: 'yszar',
           admin: 'yszar'.split(','),
           id: md5(location.pathname),
           pagerDirection: 'first',
           // facebook-like distraction free mode
           distractionFreeMode: false
         })
         gitalk.render('gitalk-container')
       </script>
     
   
 
  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script>
    
    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();

      Counter('get', '/classes/Counter', { where: JSON.stringify({ url }) })
        .done(function ({ results }) {
          if (results.length > 0) {
            var counter = results[0];
            
              var $element = $(document.getElementById(url));
              $element.find('.leancloud-visitors-count').text(counter.time + 1);
            
            Counter('put', `/classes/Counter/${counter.objectId}`, JSON.stringify({ time: { "__op":"Increment", "amount":1 } }))
            
            .fail(function ({ responseJSON }) {
                console.log('Failed to save Visitor num, with error message: ' + responseJSON.error);
            })
          } else {
            
              Counter('post', '/classes/Counter', JSON.stringify({ title: title, url: url, time: 1}))
                .done(function () {
                  var $element = $(document.getElementById(url));
                  $element.find('.leancloud-visitors-count').text(1);
                })
                .fail(function () {
                  console.log('Failed to create');
                });
            
          }
        })
      .fail(function ({ responseJSON }) {
        console.log('LeanCloud Counter Error:' + responseJSON.code + " " + responseJSON.error);
      });
    }
    

    $(function() {
      $.get('https://app-router.leancloud.cn/2/route?appId=' + "iUS887d8BnkY3Gqc9FJX70fE-gzGzoHsz")
        .done(function ({ api_server }) {
          var Counter = function (method, url, data) {
            return $.ajax({
              method: method,
              url: `https://${api_server}/1.1${url}`,
              headers: {
                'X-LC-Id': "iUS887d8BnkY3Gqc9FJX70fE-gzGzoHsz",
                'X-LC-Key': "ekF4kKyQDgrDkIBadj3IDrVA",
                'Content-Type': 'application/json',
              },
              data: data,
            });
          };
          
          addCount(Counter);
          
        })
    });
  </script>



  

  

  

  
  
  <script type="text/javascript">
  wpac_init = window.wpac_init || [];
  wpac_init.push({widget: 'Rating', id: 14244,
    el: 'wpac-rating',
    color: 'fc6423'
  });
  (function() {
    if ('WIDGETPACK_LOADED' in window) return;
    WIDGETPACK_LOADED = true;
    var mc = document.createElement('script');
    mc.type = 'text/javascript';
    mc.async = true;
    mc.src = '//embed.widgetpack.com/widget.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
  })();
  </script>


  

  

  

  

  
  <style>
    .copy-btn {
      display: inline-block;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 700;
      line-height: 20px;
      color: #333;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer;
      background-color: #eee;
      background-image: linear-gradient(#fcfcfc, #eee);
      border: 1px solid #d5d5d5;
      border-radius: 3px;
      user-select: none;
      outline: 0;
    }

    .highlight-wrap .copy-btn {
      transition: opacity .3s ease-in-out;
      opacity: 0;
      padding: 2px 6px;
      position: absolute;
      right: 4px;
      top: 8px;
    }

    .highlight-wrap:hover .copy-btn,
    .highlight-wrap .copy-btn:focus {
      opacity: 1
    }

    .highlight-wrap {
      position: relative;
    }
  </style>
  <script>
    $('.highlight').each(function (i, e) {
      var $wrap = $('<div>').addClass('highlight-wrap')
      $(e).after($wrap)
      $wrap.append($('<button>').addClass('copy-btn').append('复制').on('click', function (e) {
        var code = $(this).parent().find('.code').find('.line').map(function (i, e) {
          return $(e).text()
        }).toArray().join('\n')
        var ta = document.createElement('textarea')
        document.body.appendChild(ta)
        ta.style.position = 'absolute'
        ta.style.top = '0px'
        ta.style.left = '0px'
        ta.value = code
        ta.select()
        ta.focus()
        var result = document.execCommand('copy')
        document.body.removeChild(ta)
        
          if(result)$(this).text('复制成功')
          else $(this).text('复制失败')
        
        $(this).blur()
      })).on('mouseleave', function (e) {
        var $b = $(this).find('.copy-btn')
        setTimeout(function () {
          $b.text('复制')
        }, 300)
      }).append(e)
    })
  </script>


  
</body>
</html>
